package com.tbit.uqbike.object.pojo.vo;

import com.tbit.uqbike.object.pojo.ParamDate;
import com.tbit.uqbike.webmanager.util.csv.annotations.Csv;
import com.tbit.uqbike.webmanager.util.csv.annotations.Sum;

import java.math.BigDecimal;

/**
 * 欠款收支收支
 *
 * @Author:yanlun
 * @DATE: 2022/11/18
 */

public class AccountDayStatArrearsDetailVO extends ParamDate {

    private Integer accountId;
    /**
     * 区域
     */
    @Csv(name = "区域")
    private String accountName;
    /**
     * 日期
     */
    @Csv(name = "日期")
    private String date;
    /**
     * 欠款金额
     */
    @Sum
    @Csv(name = "欠款金额")
    private BigDecimal arrears;
    /**
     * 欠款笔数
     */
    @Sum
    @Csv(name = "欠款笔数")
    private Long arrearsCount;
    /**
     * 欠款补交金额
     */
    @Sum
    @Csv(name = "欠款补交金额")
    private BigDecimal arrearsReturn;
    /**
     * 欠款补交笔数
     */
    @Sum
    @Csv(name = "欠款补交笔数")
    private Long arrearsReturnCount;
    /**
     * 欠款补交虚拟金额
     */
    @Sum
    @Csv(name = "欠款补交虚拟金额")
    private BigDecimal arrearsFictitiousReturn;
    /**
     * 欠款补交虚拟笔数
     */
    @Sum
    @Csv(name = "欠款补交虚拟笔数")
    private Long arrearsFictitiousReturnCount;
    /**
     * 期初
     */
    @Csv(name = "期初欠款总金额")
    private BigDecimal termStart;
    /**
     * 期末
     */
    @Csv(name = "期末欠款总金额")
    private BigDecimal termEnd;

    public AccountDayStatArrearsDetailVO() {
        fillData();
    }

    public Integer getAccountId() {
        return accountId;
    }

    public void setAccountId(Integer accountId) {
        this.accountId = accountId;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public BigDecimal getArrears() {
        return arrears == null ? null : arrears.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setArrears(BigDecimal arrears) {
        this.arrears = arrears;
    }

    public Long getArrearsCount() {
        return arrearsCount;
    }

    public void setArrearsCount(Long arrearsCount) {
        this.arrearsCount = arrearsCount;
    }

    public BigDecimal getArrearsReturn() {
        return arrearsReturn == null ? null : arrearsReturn.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setArrearsReturn(BigDecimal arrearsReturn) {
        this.arrearsReturn = arrearsReturn;
    }

    public Long getArrearsReturnCount() {
        return arrearsReturnCount;
    }

    public void setArrearsReturnCount(Long arrearsReturnCount) {
        this.arrearsReturnCount = arrearsReturnCount;
    }

    public BigDecimal getArrearsFictitiousReturn() {
        return arrearsFictitiousReturn == null ? null : arrearsFictitiousReturn.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setArrearsFictitiousReturn(BigDecimal arrearsFictitiousReturn) {
        this.arrearsFictitiousReturn = arrearsFictitiousReturn;
    }

    public Long getArrearsFictitiousReturnCount() {
        return arrearsFictitiousReturnCount;
    }

    public void setArrearsFictitiousReturnCount(Long arrearsFictitiousReturnCount) {
        this.arrearsFictitiousReturnCount = arrearsFictitiousReturnCount;
    }

    public BigDecimal getTermStart() {
        return termStart == null ? null : termStart.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setTermStart(BigDecimal termStart) {
        this.termStart = termStart;
    }

    public BigDecimal getTermEnd() {
        return termEnd == null ? null : termEnd.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setTermEnd(BigDecimal termEnd) {
        this.termEnd = termEnd;
    }

    public void fillData() {
        BigDecimal bigDecimal = new BigDecimal(0);
        this.arrears = this.arrears == null ? bigDecimal : this.arrears;
        this.arrearsCount = this.arrearsCount == null ? 0L : this.arrearsCount;
        this.arrearsReturn = this.arrearsReturn == null ? bigDecimal : this.arrearsReturn;
        this.arrearsReturnCount = this.arrearsReturnCount == null ? 0L : this.arrearsReturnCount;
        this.arrearsFictitiousReturn = this.arrearsFictitiousReturn == null ? bigDecimal : this.arrearsFictitiousReturn;
        this.arrearsFictitiousReturnCount = this.arrearsFictitiousReturnCount == null ? 0L : this.arrearsFictitiousReturnCount;
        this.termStart = this.termStart == null ? bigDecimal : this.termStart;
        this.termEnd = this.termEnd == null ? bigDecimal : this.termEnd;
    }
}
